import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutterjc/plugin/CardPlugin.dart';
import 'package:flutterjc/plugin/manager/StateManager.dart';

void main() {
//  runApp(new Router2Plugin());
}

/*
 * 卡片组件 <br/>
 * 需要传入的键：<br/>
 * 传入的值类型： <br/>
 * 传入的值含义：<br/>
 * 是否必传 ：
 */
class Router2Plugin extends StatefulWidget {
  String name;

  Router2Plugin(this.name, {Key key}) : super(key: key);

  State<StatefulWidget> createState() {
    return new Router2PluginState();
  }
}

/*
 * 页面功能 <br/>
 */
class Router2PluginState extends State<Router2Plugin> {
  void initState() {
    super.initState();
    print(widget.name);
  }

  Widget build(BuildContext context) {
    AppBar appBar = AppBar(
      leading: new IconButton(
        icon: new Icon(Icons.arrow_back),
        onPressed: () {
          Navigator.pop(context);
        },
      ),
      title: new Text('FlutterDesign'),
      centerTitle: true,
      actions: <Widget>[
        new Container(width: 0, height: 0),
        new Container(width: 0, height: 0),
      ],
      backgroundColor: Colors.blue,
    );

    return MaterialApp(
      home: new Scaffold(
        appBar: appBar,
        body: new Builder(builder: (BuildContext contexts) {
          return Column(
            children: <Widget>[
              RaisedButton(
                child: Text('页面二点我返回'),
                onPressed: () {
                  Navigator.pop(context, '返回');
                },
              ),
            ],
          );
        }),
        backgroundColor: Colors.white,
        bottomNavigationBar: null,
      ),
    );
  }
}
